home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / COMPILER / SATHER / !Sather / Library / Containrs / sa / container < prev    next >
Text File  |  1996-07-16  |  1KB  |  35 lines

  1. ---------------------------> Sather 1.1 source file <--------------------------
  2. -- container_alg.sa: Operations that work by inclusion on any container
  3. -- Author: Benedict A. Gomes <gomes@tiramisu.ICSI.Berkeley.EDU>
  4. -- Copyright (C) 1995, International Computer Science Institute
  5. -- $Id: container.sa,v 1.3 1996/07/16 04:38:12 holger Exp $
  6. --
  7. -- COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
  8. -- and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
  9. -- LICENSE contained in the file: Sather/Doc/License of the
  10. -- Sather distribution. The license is also available from ICSI,
  11. -- 1947 Center St., Suite 600, Berkeley CA 94704, USA.
  12. -------------------------------------------------------------------
  13.  
  14. abstract class $CONTAINER{ETP} < $ELT{ETP} is
  15.    -- The basic abstract container type
  16.    -- Does not have a create:SAME method, since this does not make sense
  17.    -- for arrays and other indexible types, where the create should 
  18.    -- take SAME as an argument
  19.    -- Inherits: elt!, str
  20.  
  21.     copy: SAME;
  22.     -- Return a copy of the current container
  23.     -- post result = self
  24.  
  25.    size: INT;
  26.    -- Number of elements actually inserted
  27.    
  28.    has(e: ETP): BOOL;
  29.    -- pre ~void(self)
  30.    -- True if the container contains the element "e"
  31.    
  32.    
  33. end;
  34. -------------------------------------------------------------------   
  35.